package com.lanou.web.servlet;

import com.lanou.service.PrizeService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/lottery")
public class LotteryServlet extends HttpServlet {

    private PrizeService prizeService = new PrizeService();

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,
            IOException {
        Integer prizeId = prizeService.doLottery();
        response.getWriter().print(prizeId);
    }
}
